<?php

namespace App\Http\Controllers;

use App\Exceptions\AppException;
use App\Http\Requests\AdminPost;
use App\Models\User;
use App\Services\AppUser;
use App\Services\ValidatorService;
use Illuminate\Support\Facades\Validator;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redis;
use Tymon\JWTAuth\JWTAuth;

class AdminController extends Controller
{


    public function index()
    {
        $user = AppUser::getInstance()->getUserName();
        print_r($user);die;
        try {
            $user = User::query()->where('user_id', 1)->firstOrFail();

        } catch (\ Exception $exception){
            throw new AppException('create_project_fail');

        }
        return $this->success($user);
    }

    public function getGoods($id, Request $request)
    {
        $validate = [
            'face'     => 'required|user',
        ];
        ValidatorService::paramsValidate($request->all(), $validate);
        return $this->success($request->all());

    }
}
